<?php
/**
 * Config Model
 */
class Config extends AppModel
{
    /**
     * associations
     *
     * @var array
     */

    function getConfigById($id){
        $conditions = array(
            'Config.id' => $id,
        );
        # fetch the specific data from the server and retrun it.
        return $this->find('first', array('conditions' => $conditions, 'recursive' => -1));
    }

    function getConfigByKey($key){
        $conditions = array(
            'Config.key' => $key,
        );
        # fetch the specific data from the server and retrun it.
        return $this->find('first', array('conditions' => $conditions, 'recursive' => -1));
    }

    function getConfigs(){
        # fetch the specific data from the server and retrun it.
        return $this->find('all');
    }

}